@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="documentsForm">

            <input type="hidden" id="id" value="${documents.id}">
            <input type="hidden" id="descVal" value="${documents.desc}">

            <div class="row">
                <div class="col-sm-10">
                    <div class="form-group">
                        <label class="col-sm-3 control-label head-scu-label">封面图</label>
                        <div class="col-sm-4">
                            <div id="imagePreId">
                                <div><img width="100px" height="100px"
                                          @if(isEmpty(documents.image)){
                                          src="${ctxPath}/static/img/girl.gif"></div>
                                @}else{
                                src="${ctxPath}/kaptcha/${documents.image}">
                            </div>
                            @}
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="head-scu-btn upload-btn" id="imageBtnId">
                            <i class="fa fa-upload"></i>&nbsp;上传
                        </div>
                    </div>
                    <input type="hidden" id="image" value="${documents.image}"/>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">文档标题</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="documentName" name="documentName" type="text"
                               value="${documents.documentName}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">标签</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="tag" name="tag" type="text"
                               value="${documents.tag}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">上传者</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="operator" name="operator" type="text"
                               value="${documents.operator}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">简介</label>
                    <div class="col-sm-9">
                        <div id="editor" class="editorHeight">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">分类</label>
                    <div class="col-sm-9">
                        <select class="form-control" id="categoryId"
                                onchange="DocumentsInfoEditDlg.getCategoryChildList(this.options[this.options.selectedIndex].value)">
                            @if(documents.categoryId == null){
                            <option value="" selected="selected">请选择</option>
                            @}
                            @for(category in categoryList){
                            @if(category.id == documents.categoryId){
                            <option value="${category.id}" selected="selected">${category.categoryName}</option>
                            @}else{
                            <option value="${category.id}">${category.categoryName}</option>
                            @}
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">子分类</label>
                    <div class="col-sm-9">
                        <select class="form-control" id="categoryChildId">
                            @for(item in categoryChildList){
                            @if(item.id == documents.categoryChildId){
                            <option value="${item.id}" selected="selected">${item.categoryName}</option>
                            @}else{
                            <option value="${item.id}">${item.categoryName}</option>
                            @}
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">收费类型</label>
                    <div class="col-sm-9">
                        <select class="form-control" id="priceType"
                                onchange="DocumentsInfoEditDlg.changePricetype(this.options[this.options.selectedIndex].value)">
                            @if(documents.priceType == 0){
                                <option value="0" selected="selected">免费文档</option>
                                <option value="1">会员免费</option>
                                <option value="2">会员优惠</option>
                            @}else if(documents.priceType == 1){
                                <option value="0" >免费文档</option>
                                <option value="1" selected="selected">会员免费</option>
                                <option value="2">会员优惠</option>
                            @}else{
                                <option value="0">免费文档</option>
                                <option value="1">会员免费</option>
                                <option value="2" selected="selected">会员优惠</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group" id="normalPriceDiv">

                    <label class="col-sm-3 control-label">用户购买价格</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="normalPrice" name="normalPrice" type="text"
                               placeholder="收费类型为免费文档可不填，其它必填，保留两位小数"
                               @if(documents.priceType == 0){
                               value=""
                               @}else{
                               value="${documents.normalPrice}"
                               @}
                        />
                    </div>
                </div>
                <div class="form-group" id="memberPriceDiv">
                    <label class="col-sm-3 control-label">会员优惠价格</label>
                    <div class="col-sm-9">

                        <input class="form-control" id="memberPrice" name="memberPrice" type="text"
                               placeholder="收费类型为会员优惠必填，其它可为空，保留两位小数"
                               @if(documents.priceType == 2){
                               value="${documents.memberPrice}"
                               @}else{
                               value=""
                               @}
                        />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">下载地址</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" value="${documents.downloadUrl}"  readonly="readonly"/>
                    </div>
                </div>

            </div>
        </div>

        <div class="row btn-group-m-t">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-9">
                <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="DocumentsInfoEditDlg.editSubmit()"/>
                <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="DocumentsInfoEditDlg.close()"/>
            </div>
        </div>
        <div class="progress progress-striped" id="progressTipArea" style="margin-top: 20px;">
            <div id="progressBar" style="width: 0%" aria-valuemax="100" aria-valuemin="0"
                 aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-info">
            </div>
        </div>
    </div>
</div>
</div>
<script type="text/javascript" src="${ctxPath}/static/js/plugins/wangEditor/wangEditor.js"></script>
<script src="${ctxPath}/static/modular/system/documents/documents_info_edit.js"></script>
<script src="${ctxPath}/static/js/common/web-upload-object.js"></script>
@}
